﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Net;
using System.Xml.Serialization;
using System.IO;
using System.Runtime.Serialization.Json;

public partial class include_TimKiemTheoQuanHuyen : System.Web.UI.UserControl
{
    void loadQuanHuyen()
    {
        //WebRequest wr = WebRequest.Create("http://localhost:49732/Service.svc/quanhuyen");
        //WebResponse wp = wr.GetResponse();
        //XmlSerializer xml = new XmlSerializer(typeof(ArrayOfLopDTO));
        //ArrayOfLopDTO ds = (ArrayOfLopDTO)xml.Deserialize(wp.GetResponseStream());
        //cbbLop.DataSource = ds.Items;
        //cbbLop.DisplayMember = "TenLop";
        //cbbLop.ValueMember = "MaLop";
        //WebClient client = new WebClient();
        //byte[] data = client.DownloadData("http://localhost:49732/Service.svc/quanhuyen");
        //Stream stream = new MemoryStream(data);
        //DataContractJsonSerializer obj = new DataContractJsonSerializer(typeof(string));
        //string result = obj.ReadObject(stream).ToString();
        //ddlQuanHuyen.DataSource = result;
        //ddlQuanHuyen.DataTextField = "TenQuanHuyen";
        //ddlQuanHuyen.DataValueField = "MaQuanHuyen";
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        loadQuanHuyen();
    }
}